\(\int \frac {x^2 (a+b \arctan (c x))^2}{d+e x^2} \, dx\) [1262]

   Optimal result
   Rubi [A] (verified)
   Mathematica [F(-1)]
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F(-2)]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 23, antiderivative size = 554 \[ \int \frac {x^2 (a+b \arctan (c x))^2}{d+e x^2} \, dx=\frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {2 b (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{c e}+\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}-\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {i b^2 \operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{c e}-\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}}-\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}} \]

[Out]

I*(a+b*arctan(c*x))^2/c/e+x*(a+b*arctan(c*x))^2/e+2*b*(a+b*arctan(c*x))*ln(2/(1+I*c*x))/c/e+I*b^2*polylog(2,1-
2/(1+I*c*x))/c/e+1/2*(a+b*arctan(c*x))^2*ln(2*c*((-d)^(1/2)-x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)-I*e^(1/2)))*(-d
)^(1/2)/e^(3/2)-1/2*(a+b*arctan(c*x))^2*ln(2*c*((-d)^(1/2)+x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)+I*e^(1/2)))*(-d)
^(1/2)/e^(3/2)-1/2*I*b*(a+b*arctan(c*x))*polylog(2,1-2*c*((-d)^(1/2)-x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)-I*e^(1
/2)))*(-d)^(1/2)/e^(3/2)+1/2*I*b*(a+b*arctan(c*x))*polylog(2,1-2*c*((-d)^(1/2)+x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1
/2)+I*e^(1/2)))*(-d)^(1/2)/e^(3/2)+1/4*b^2*polylog(3,1-2*c*((-d)^(1/2)-x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)-I*e^
(1/2)))*(-d)^(1/2)/e^(3/2)-1/4*b^2*polylog(3,1-2*c*((-d)^(1/2)+x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)+I*e^(1/2)))*
(-d)^(1/2)/e^(3/2)

Rubi [A] (verified)

Time = 0.36 (sec) , antiderivative size = 554, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {5036, 4930, 5040, 4964, 2449, 2352, 5034, 4968} \[ \int \frac {x^2 (a+b \arctan (c x))^2}{d+e x^2} \, dx=-\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{(1-i c x) \left (c \sqrt {-d}-i \sqrt {e}\right )}\right )}{2 e^{3/2}}-\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{(1-i c x) \left (c \sqrt {-d}+i \sqrt {e}\right )}\right )}{2 e^{3/2}}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {i (a+b \arctan (c x))^2}{c e}+\frac {2 b \log \left (\frac {2}{1+i c x}\right ) (a+b \arctan (c x))}{c e}+\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}}-\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}}+\frac {i b^2 \operatorname {PolyLog}\left (2,1-\frac {2}{i c x+1}\right )}{c e} \]

[In]

Int[(x^2*(a + b*ArcTan[c*x])^2)/(d + e*x^2),x]

[Out]

(I*(a + b*ArcTan[c*x])^2)/(c*e) + (x*(a + b*ArcTan[c*x])^2)/e + (2*b*(a + b*ArcTan[c*x])*Log[2/(1 + I*c*x)])/(
c*e) + (Sqrt[-d]*(a + b*ArcTan[c*x])^2*Log[(2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[e])*(1 - I*c*x))
])/(2*e^(3/2)) - (Sqrt[-d]*(a + b*ArcTan[c*x])^2*Log[(2*c*(Sqrt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1
 - I*c*x))])/(2*e^(3/2)) + (I*b^2*PolyLog[2, 1 - 2/(1 + I*c*x)])/(c*e) - ((I/2)*b*Sqrt[-d]*(a + b*ArcTan[c*x])
*PolyLog[2, 1 - (2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[e])*(1 - I*c*x))])/e^(3/2) + ((I/2)*b*Sqrt[
-d]*(a + b*ArcTan[c*x])*PolyLog[2, 1 - (2*c*(Sqrt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))])/e
^(3/2) + (b^2*Sqrt[-d]*PolyLog[3, 1 - (2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[e])*(1 - I*c*x))])/(4
*e^(3/2)) - (b^2*Sqrt[-d]*PolyLog[3, 1 - (2*c*(Sqrt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))])
/(4*e^(3/2))

Rule 2352

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLog[2, 1 - c*x], x] /; FreeQ[{c, d, e
}, x] && EqQ[e + c*d, 0]

Rule 2449

Int[Log[(c_.)/((d_) + (e_.)*(x_))]/((f_) + (g_.)*(x_)^2), x_Symbol] :> Dist[-e/g, Subst[Int[Log[2*d*x]/(1 - 2*
d*x), x], x, 1/(d + e*x)], x] /; FreeQ[{c, d, e, f, g}, x] && EqQ[c, 2*d] && EqQ[e^2*f + d^2*g, 0]

Rule 4930

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x^n])^p, x] - Dist[b*c
*n*p, Int[x^n*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))), x], x] /; FreeQ[{a, b, c, n}, x] && IGtQ[p, 0
] && (EqQ[n, 1] || EqQ[p, 1])

Rule 4964

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-(a + b*ArcTan[c*x])^p)*(
Log[2/(1 + e*(x/d))]/e), x] + Dist[b*c*(p/e), Int[(a + b*ArcTan[c*x])^(p - 1)*(Log[2/(1 + e*(x/d))]/(1 + c^2*x
^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 + e^2, 0]

Rule 4968

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^2/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-(a + b*ArcTan[c*x])^2)*(Log[
2/(1 - I*c*x)]/e), x] + (Simp[(a + b*ArcTan[c*x])^2*(Log[2*c*((d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/e), x] + S
imp[I*b*(a + b*ArcTan[c*x])*(PolyLog[2, 1 - 2/(1 - I*c*x)]/e), x] - Simp[I*b*(a + b*ArcTan[c*x])*(PolyLog[2, 1
 - 2*c*((d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/e), x] - Simp[b^2*(PolyLog[3, 1 - 2/(1 - I*c*x)]/(2*e)), x] + Si
mp[b^2*(PolyLog[3, 1 - 2*c*((d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/(2*e)), x]) /; FreeQ[{a, b, c, d, e}, x] &&
NeQ[c^2*d^2 + e^2, 0]

Rule 5034

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((d_) + (e_.)*(x_)^2)^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a
+ b*ArcTan[c*x])^p, (d + e*x^2)^q, x], x] /; FreeQ[{a, b, c, d, e}, x] && IntegerQ[q] && IGtQ[p, 0]

Rule 5036

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2/
e, Int[(f*x)^(m - 2)*(a + b*ArcTan[c*x])^p, x], x] - Dist[d*(f^2/e), Int[(f*x)^(m - 2)*((a + b*ArcTan[c*x])^p/
(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rule 5040

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*(x_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(-I)*((a + b*ArcT
an[c*x])^(p + 1)/(b*e*(p + 1))), x] - Dist[1/(c*d), Int[(a + b*ArcTan[c*x])^p/(I - c*x), x], x] /; FreeQ[{a, b
, c, d, e}, x] && EqQ[e, c^2*d] && IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\int (a+b \arctan (c x))^2 \, dx}{e}-\frac {d \int \frac {(a+b \arctan (c x))^2}{d+e x^2} \, dx}{e} \\ & = \frac {x (a+b \arctan (c x))^2}{e}-\frac {(2 b c) \int \frac {x (a+b \arctan (c x))}{1+c^2 x^2} \, dx}{e}-\frac {d \int \left (\frac {\sqrt {-d} (a+b \arctan (c x))^2}{2 d \left (\sqrt {-d}-\sqrt {e} x\right )}+\frac {\sqrt {-d} (a+b \arctan (c x))^2}{2 d \left (\sqrt {-d}+\sqrt {e} x\right )}\right ) \, dx}{e} \\ & = \frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {(2 b) \int \frac {a+b \arctan (c x)}{i-c x} \, dx}{e}-\frac {\sqrt {-d} \int \frac {(a+b \arctan (c x))^2}{\sqrt {-d}-\sqrt {e} x} \, dx}{2 e}-\frac {\sqrt {-d} \int \frac {(a+b \arctan (c x))^2}{\sqrt {-d}+\sqrt {e} x} \, dx}{2 e} \\ & = \frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {2 b (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{c e}+\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}-\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}-\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}}-\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}}-\frac {\left (2 b^2\right ) \int \frac {\log \left (\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{e} \\ & = \frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {2 b (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{c e}+\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}-\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}-\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}}-\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}}+\frac {\left (2 i b^2\right ) \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1+i c x}\right )}{c e} \\ & = \frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {2 b (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{c e}+\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}-\frac {\sqrt {-d} (a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {i b^2 \operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{c e}-\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {i b \sqrt {-d} (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 e^{3/2}}+\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}}-\frac {b^2 \sqrt {-d} \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 e^{3/2}} \\ \end{align*}

Mathematica [F(-1)]

Timed out. \[ \int \frac {x^2 (a+b \arctan (c x))^2}{d+e x^2} \, dx=\text {\$Aborted} \]

[In]

Integrate[(x^2*(a + b*ArcTan[c*x])^2)/(d + e*x^2),x]

[Out]

$Aborted

Maple [F]

\[\int \frac {x^{2} \left (a +b \arctan \left (c x \right )\right )^{2}}{e \,x^{2}+d}d x\]

[In]

int(x^2*(a+b*arctan(c*x))^2/(e*x^2+d),x)

[Out]

int(x^2*(a+b*arctan(c*x))^2/(e*x^2+d),x)

Fricas [F]

\[ \int \frac {x^2 (a+b \arctan (c x))^2}{d+e x^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2} x^{2}}{e x^{2} + d} \,d x } \]

[In]

integrate(x^2*(a+b*arctan(c*x))^2/(e*x^2+d),x, algorithm="fricas")

[Out]

integral((b^2*x^2*arctan(c*x)^2 + 2*a*b*x^2*arctan(c*x) + a^2*x^2)/(e*x^2 + d), x)

Sympy [F]

\[ \int \frac {x^2 (a+b \arctan (c x))^2}{d+e x^2} \, dx=\int \frac {x^{2} \left (a + b \operatorname {atan}{\left (c x \right )}\right )^{2}}{d + e x^{2}}\, dx \]

[In]

integrate(x**2*(a+b*atan(c*x))**2/(e*x**2+d),x)

[Out]

Integral(x**2*(a + b*atan(c*x))**2/(d + e*x**2), x)

Maxima [F(-2)]

Exception generated. \[ \int \frac {x^2 (a+b \arctan (c x))^2}{d+e x^2} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(x^2*(a+b*arctan(c*x))^2/(e*x^2+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(e>0)', see `assume?` for more
details)Is e

Giac [F]

\[ \int \frac {x^2 (a+b \arctan (c x))^2}{d+e x^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2} x^{2}}{e x^{2} + d} \,d x } \]

[In]

integrate(x^2*(a+b*arctan(c*x))^2/(e*x^2+d),x, algorithm="giac")

[Out]

sage0*x

Mupad [F(-1)]

Timed out. \[ \int \frac {x^2 (a+b \arctan (c x))^2}{d+e x^2} \, dx=\int \frac {x^2\,{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2}{e\,x^2+d} \,d x \]

[In]

int((x^2*(a + b*atan(c*x))^2)/(d + e*x^2),x)

[Out]

int((x^2*(a + b*atan(c*x))^2)/(d + e*x^2), x)